-
Notifications
You must be signed in to change notification settings - Fork 16.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AP_Camera: Add mount angles in camera log message #23837
Conversation
7d23eef
to
657f358
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see any discussion on the relative merits of this data.
Isn't it redundant with the existing mount logging?
If we log too much data then people start getting gaps in their logs - and that often makes the logs useless. So we shouldn't log redundant data when we don't need to.
I think it's important that the CAM message include all the data that someone needs to figure out the location and attitude of the camera at the moment the picture was taken. People are very sensitive to timing so I think it needs to be logged at exactly the same time. I also think that users will struggle with the external tools if that requires pulling data from multiple messages. BTW, this CAM message is output only when pictures are taken so it's not going to take up any space in the overall scheme of things. One question I have is whether we should also log the mount's yaw in earth-frame. I think the new mount_yaw field is body-frame meaning that users will need to add it to the vehicle's yaw. If that's too annoying we could perhaps have both MYawBF and MYawEF fields. FYI @CraigElder |
03d061f
to
b4d53ce
Compare
I retract my objections here - camera messages are low-bandwidth and having the mount data directly against it makes some sense. Does need to pass CI, 'though :-) |
Thanks for this, in general it looks pretty good. I really like that you've tried to add both the target angle and the actual angles but I see this is making the change quite a bit more difficult because the target angle may not be readily available from all backends. If this is the case you could reduce the complexity and just log the current actual angles. |
d08a467
to
4933326
Compare
Pardon me for stylistic mistakes in this one, Actually i wanna know if the approach is right. It stores the target angles in mnt_target for all the possible mount modes. However it costs a lot more flash space. |
b992e80
to
46356a2
Compare
I think Peter's request has been superceded by other changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ready to go but I'd appreciate any other feedback from other devs because it is a fairly extensive change.
This PR adds logging of the mount's desired and actual roll, pitch and yaw angles. Both body-frame and earth-frame yaw angles are logged but only one of either DesYawE and DesYawB will ever be non-NaN (because the target will only ever be one of these two).
The mount's angles are logged at 10hz and then again whenever a camera picture is taken (in which case the CAM and MNT message's TimeUS fields will be identical).
Also included are numerous fixes found during testing:
fixes #23816 which is an issue from #20985
This has been tested on real hardware including:
Below is a sample picture of the tests run on the DJI RS2. We can see how the actual angles follow behind the desired angles.